package com.neusoft.classch76;

public class Student {

	// 学校
	public static final String SCHOOL = "TJEDU";
	
	//学生总人数
	static int StuNum = 0;
	// 姓名
	private String stuName;
	// 学号
	private String stuNo;
	//性别
	private String stuGender;
	//年龄
	private int stuAge;
	//期中成绩
	private double scoreOfMidTerm;
	//期末考试成绩
	private double scoreOfFinal;
	//综合成绩
	private double overall;
	

	// 方法
	//final方法能继承吗
	public final void print() {
		System.out.println("父类的final方法");
	}
	
	public double calculateOverall() {
		overall = scoreOfMidTerm*0.5+scoreOfFinal*0.5;
		return overall;
	}
	
	public void printOverall() {
		System.out.println("学号："+stuNo+" 姓名："+stuName
							+" 性别："+stuGender+" 年龄："
							+stuAge+" 综合成绩："+this.calculateOverall());
	}
	
	
	// 构造方法

	/**
	 * 
	 * @param stuName
	 *            姓名
	 * @param stuNo
	 *            学号
	 */
	

	public Student() {
		super();
		StuNum++;
		// TODO Auto-generated constructor stub
	}

	public Student(String stuName, String stuNo, String stuGender, int stuAge, double scoreOfMidTerm,
			double scoreOfFinal) {
		super();
		StuNum++;
		this.stuName = stuName;
		this.stuNo = stuNo;
		this.stuGender = stuGender;
		this.stuAge = stuAge;
		this.scoreOfMidTerm = scoreOfMidTerm;
		this.scoreOfFinal = scoreOfFinal;
	}

	// get&set
	public String getStuName() {
		return stuName;
	}

	public void setStuName(String stuName) {
		this.stuName = stuName;
	}

	public String getStuNo() {
		return stuNo;
	}

	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}

	public static String getSchool() {
		return SCHOOL;
	}

	public String getStuGender() {
		return stuGender;
	}

	public void setStuGender(String stuGender) {
		this.stuGender = stuGender;
	}

	public int getStuAge() {
		return stuAge;
	}

	public void setStuAge(int stuAge) {
		this.stuAge = stuAge;
	}

	public double getScoreOfMidTerm() {
		return scoreOfMidTerm;
	}

	public void setScoreOfMidTerm(double scoreOfMidTerm) {
		this.scoreOfMidTerm = scoreOfMidTerm;
	}

	public double getScoreOfFinal() {
		return scoreOfFinal;
	}

	public void setScoreOfFinal(double scoreOfFinal) {
		this.scoreOfFinal = scoreOfFinal;
	}

	public double getOverall() {
		return overall;
	}

	public void setOverall(double overall) {
		this.overall = overall;
	}

}
